﻿Imports DataSet_ohlTableAdapters

Partial Class Consulta_ConCrias
    Inherits System.Web.UI.Page
    Dim Animales As New animalTableAdapter

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        gvAnimales.DataSource = Animales.GetAnimalByClave("%")
        gvAnimales.DataBind()
    End Sub

    Protected Sub txtAnimal_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtAnimal.TextChanged
        gvAnimales.DataSource = Animales.GetAnimalByClave(txtAnimal.Text + "%")
        gvAnimales.DataBind()
        txtMadre.Text = ""
        txtPadre.Text = ""
        txtAnimal.Focus()
    End Sub

    Protected Sub txtPadre_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtPadre.TextChanged
        gvAnimales.DataSource = Animales.GetAnimalByPadre(txtPadre.Text + "%")
        gvAnimales.DataBind()
        txtMadre.Text = ""
        txtAnimal.Text = ""
        txtPadre.Focus()
    End Sub

    Protected Sub txtMadre_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtMadre.TextChanged
        gvAnimales.DataSource = Animales.GetAnimalByMadre(txtMadre.Text + "%")
        gvAnimales.DataBind()
        txtAnimal.Text = ""
        txtPadre.Text = ""
        txtMadre.Focus()
    End Sub

    Protected Sub gvAnimales_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gvAnimales.PageIndexChanging
        gvAnimales.PageIndex = e.NewPageIndex
        gvAnimales.DataBind()
    End Sub

End Class
